/**
 * @file index.css
 * @description 推荐热门组件样式，支持子分类切换
 * @copyright 版权所有 (c) 2025 UIED技术团队
 * @website https://fsuied.com
 * @license MIT
 * @version 1.1.0 - 增加子分类支持
 */

/* ===== 推荐热门组件样式 ===== */
.hot-recommendations {
  margin: 0 0 1rem 0;
  padding: 0;
}

/* 头部标题区域 */
.hot-recommendations-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 8px;
}

.hot-recommendations-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  position: relative;
}

.hot-recommendations-title::before {
  content: '';
  width: 0.25rem;
  height: 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  border-radius: 0.125rem;
  flex-shrink: 0;
}

/* 下面的样式已不再使用，已通过修改组件结构来避免冲突 */

/* 统计信息 */
.recommendations-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.stats-item {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.stats-number {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 1rem;
}

.stats-label {
  font-weight: 400;
  color: var(--text-secondary);
}

.stats-divider {
  color: var(--text-light);
  font-weight: 300;
}

/* ===== 子分类切换标签样式 ===== */
.hot-recommendations-subcategories {
  margin-bottom: 1rem;
  padding: 0;
}

.subcategory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.subcategory-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  flex: 1;
}

.subcategory-tabs::-webkit-scrollbar {
  height: 4px;
}

.subcategory-tabs::-webkit-scrollbar-track {
  background: var(--background-light);
  border-radius: 2px;
}

.subcategory-tabs::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.subcategory-tabs::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

.subcategory-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  background: transparent;
  border: 0.0625rem solid var(--border-color);
  border-radius: 1rem;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

.subcategory-tab:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.subcategory-tab.active {
  background: transparent;
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.subcategory-tab.active:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.tab-name {
  font-weight: 500;
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.1875rem;
  background: var(--border-color);
  border-radius: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text-light);
}

.subcategory-tab.active .tab-count {
  background: var(--primary-color);
  color: var(--white);
}

.subcategory-tab:hover:not(.active) .tab-count {
  background: var(--primary-color);
  color: var(--white);
}

/* ===== 分页控件样式 ===== */
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: 0.0625rem solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.pagination-btn:hover:not(.disabled) {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.pagination-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 3rem;
  text-align: center;
}

/* 工具网格布局 - 与Home页面tools-grid保持一致 */
.hot-recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* 自适应布局 */
  gap: 0.75rem; /* 与Home页面一致 */
  margin: 0;
}

/* 超大屏幕最多显示6列 */
@media (min-width: 1600px) {
  .hot-recommendations-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* 大屏幕显示4-5列 */
@media (min-width: 1200px) and (max-width: 1599px) {
  .hot-recommendations-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 中等屏幕显示3列 */
@media (min-width: 901px) and (max-width: 1199px) {
  .hot-recommendations-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 小屏幕显示2列 */
@media (min-width: 769px) and (max-width: 900px) {
  .hot-recommendations-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 移动端显示1列 */
@media (max-width: 768px) {
  .hot-recommendations-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem; /* 与Home页面移动端一致 */
  }
  
  .hot-recommendations-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .hot-recommendations-title {
    font-size: 1.25rem;
  }
  
  .title-decoration {
    display: none; /* 移动端隐藏装饰文字 */
  }
  
  /* 移动端子分类和分页优化 */
  .subcategory-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .subcategory-tabs {
    gap: 0.25rem;
    padding-bottom: 0.375rem;
    width: 100%;
  }
  
  .subcategory-tab {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
  
  .tab-count {
    min-width: 0.875rem;
    height: 0.875rem;
    font-size: 0.625rem;
  }
  
  .pagination-controls {
    align-self: flex-end;
  }
  
  .pagination-btn {
    width: 1.75rem;
    height: 1.75rem;
  }
  
  .pagination-info {
    font-size: 0.75rem;
    min-width: 2.5rem;
  }
}

/* 底部查看更多按钮 - 隐藏状态 */
.hot-recommendations-footer {
  display: none; /* 默认隐藏 */
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 0.0625rem solid var(--border-color);
}

/* 如果需要显示查看更多按钮，添加.show-more-button类 */
.hot-recommendations.show-more-button .hot-recommendations-footer {
  display: block;
}

.see-more-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: var(--white);
  border: 0.125rem solid var(--primary-color);
  border-radius: var(--border-radius);
  color: var(--primary-color);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.see-more-button:hover {
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-0.125rem);
}

.see-more-button:active {
  transform: translateY(0);
}

.see-more-button svg {
  transition: transform var(--transition-fast);
}

.see-more-button:hover svg {
  transform: translateX(0.125rem);
}

/* 加载状态 */
.hot-recommendations.loading {
  opacity: 0.7;
  pointer-events: none;
}

.hot-recommendations.loading .hot-recommendations-grid {
  filter: blur(0.5px);
}

/* 空状态 */
.hot-recommendations-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.hot-recommendations-empty h3 {
  font-size: 1.125rem;
  font-weight: 500;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.hot-recommendations-empty p {
  font-size: 0.875rem;
  margin: 0;
  color: var(--text-light);
}

/* 优化工具卡片在推荐组件中的显示 - 与Home页面保持一致 */
.hot-recommendations .tool-item-card {
  background: var(--white);
  border-radius: 0.5rem;
  padding: 0.875rem;
  border: 0.0625rem solid #e1e5e9;
  transition: border-color 0.3s ease;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  /* 统一卡片大小 - 固定高度和宽度，与Home页面一致 */
  height: 120px;
  overflow: hidden;
  /* 确保卡片不会被内容撑大 */
  box-sizing: border-box;
}

.hot-recommendations .tool-item-card:hover {
  border-color: var(--primary-color);
}

/* 暗色模式适配 */
